#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 5e4 + 10;
const int B = 70;

int n, m, a[N];
int cnt[N];
ll cur, ans[N];

struct qry {
	int l, r, bl, id;
} t[N];

int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "r", stdin);
#endif
	n = in, m = in; rep(i, 1, n) a[i] = in;
	rep(i, 1, m) t[i].l = in, t[i].r = in, t[i].bl = (t[i].l - 1) / B + 1, t[i].id = i;
	sort(t + 1, t + m + 1, [&](auto x, auto y) {
		return x.bl ^ y.bl ? x.bl < y.bl : x.bl & 1 ? x.r < y.r : x.r > y.r; 
	});
	int l = 1, r = 0;
	rep(i, 1, m) {
		auto x = t[i];
		if(x.l == x.r) { ans[x.id] = -1; continue; }
		while(r < x.r) //r++, cnt[a[r]]++, ans += cnt[a[r] - 1];
			cur += cnt[a[++r]]++;
		while(r > x.r)
			cur -= --cnt[a[r--]];
		while(l > x.l)
			cur += cnt[a[--l]]++;
		while(l < x.l) //cnt[a[l]]--, cur -= cnt[a[l]], l++;
			cur -= --cnt[a[l++]];
		ans[x.id] = cur;
	}
	sort(t + 1, t + m + 1, [&](auto x, auto y) { return x.id < y.id; });
	rep(i, 1, m) {
		ll x = ans[i];
		if(x == -1) puts("0/1");
		else {
			ll y = 1ll * (t[i].r - t[i].l) * (t[i].r - t[i].l + 1) / 2;
			//cerr << t[i].id << " " << t[i].l << " " << t[i].r << " " << x << " " << y << endl; 
			ll g = __gcd(x, y);
			x /= g, y /= g; printf("%lld/%lld\n", x, y);
		}
	}
	return 0;
}
